﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!-- Resource dictionary entries should be defined here. -->

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle Margin="2"
                               StrokeThickness="1"
                               Stroke="Black"
                               StrokeDashArray="1 2"
                               SnapsToDevicePixels="true"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="Background" Value="{DynamicResource DefaultBackground}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{DynamicResource DefaultTextForeground}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Margin" Value="5"/>
        <Setter Property="Height" Value="23"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="OuterBorder" 
								CornerRadius="6" 
								BorderBrush="{DynamicResource DefaultBorder}" 
								BorderThickness="1" 
								Background="{DynamicResource DefaultBackground}">

                            <Border x:Name="InnerBorder" 
									CornerRadius="5" 
									BorderBrush="{DynamicResource DefaultBorder}" 
									BorderThickness="1">
                                
                             <ContentPresenter 
								SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
								Margin="{TemplateBinding Padding}" 
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
								RecognizesAccessKey="True"/>
                            </Border>
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>
                        
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource OnMouseOverBrush}"/>
                        </Trigger>
                        
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource OnPressBackground}"/>
                        </Trigger>


                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="InnerBorder" Property="BorderBrush" Value="{DynamicResource InnerBorderDisabled}"/>
                            <Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource OuterBorderDisabled}"/>
                            <Setter Property="Foreground" Value="{DynamicResource InnerBorderDisabled}"/>
                        </Trigger>
                        
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SearchButton" TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="Background" Value="{DynamicResource DefaultBackground}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Foreground" Value="{DynamicResource DefaultTextForeground}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Margin" Value="1,0,0,0"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid>
                        <Border x:Name="OuterBorder" 
                                                CornerRadius="1" 
                                                BorderBrush="{DynamicResource DefaultBorder}" 
                                                BorderThickness="1" 
                                                Background="{DynamicResource DefaultBackground}">
                            <ContentPresenter 
                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                Margin="{TemplateBinding Padding}" 
                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                                RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>

                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource OnMouseOverBrush}"/>
                        </Trigger>

                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="OuterBorder" Property="Background" Value="{DynamicResource OnPressBackground}"/>
                        </Trigger>


                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="OuterBorder" Property="BorderBrush" Value="{DynamicResource DefaultBrush}"/>
                            <Setter Property="Foreground" Value="{DynamicResource InnerBorderDisabled}"/>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!-- MenuButtonStyle -->
    <Style x:Uid="MenuButtonStyle" x:Key="MenuButtonStyle" BasedOn="{x:Null}" TargetType="{x:Type Button}">
        <Setter x:Uid="Setter_3" Property="Template">
            <Setter.Value>
                <ControlTemplate x:Uid="ControlTemplate_1" TargetType="{x:Type Button}">
                    <Grid x:Uid="Grid_1">
                        <Rectangle x:Uid="rectangle" Opacity="0" Fill="#66FFFFFF" Stroke="{x:Null}" StrokeThickness="0.5" HorizontalAlignment="Stretch" Margin="0,2,2,2" x:Name="rectangle" VerticalAlignment="Stretch"/>
                        <Path x:Uid="Path_1" Fill="{x:Null}" Stretch="Fill" Stroke="#7FFFFFFF" StrokeThickness="1" HorizontalAlignment="Right" Margin="0,4,0.5,4" Width="1" Height="17" Grid.RowSpan="1" Data="M-87.28,4 L-87.28,17"/>
                        <ContentPresenter x:Uid="ContentPresenter_1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          Margin="10,0,10,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                          TextElement.Foreground="{DynamicResource DefaultTextForeground}" 
                                          RecognizesAccessKey="True"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger x:Uid="Trigger_1" Property="IsFocused" Value="True"/>
                        <Trigger x:Uid="Trigger_2" Property="IsDefaulted" Value="True"/>
                        <Trigger x:Uid="Trigger_3" Property="IsMouseOver" Value="True">
                            <Setter x:Uid="Setter_4" Property="Opacity" TargetName="rectangle" Value="0.5"/>
                        </Trigger>
                        <Trigger x:Uid="Trigger_4" Property="IsPressed" Value="True">
                            <Setter x:Uid="Setter_5" Property="Opacity" TargetName="rectangle" Value="1"/>
                            <Setter x:Uid="Setter_7" Property="Fill" TargetName="rectangle" Value="#B6B6B7"/>
                        </Trigger>
                        <Trigger x:Uid="Trigger_5" Property="IsEnabled" Value="False"/>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>